home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / c_wndw.zip / JUSTIFY1.C < prev    next >
Text File  |  1989-05-25  |  2KB  |  63 lines

  1. /*  (c) Marietta Systems, Inc.
  2. *   All rights reserved
  3. *
  4. *   Demonstration program for the justify function
  5. */
  6. #include "mtest.h"
  7. void main(){
  8. int x = 2;
  9. byte p1[40];
  10. static byte p2[30] = "  0a2b3,4.34-.67+2k4         ";
  11. clr_scrn("Justify test");
  12. /*    */
  13. display("Source text: ", 2, 15, low);
  14. display(p2, 2, 28, alt_reverse);
  15. mk_wndw(5,14, 20,66, "Justified text");
  16. /*
  17. *
  18. */
  19. justify(left,     p1, p2, 15, 0); 
  20. display("left 15  ", x, 2, high); display(p1, x++, 14, alt_reverse); 
  21. /*    */
  22. justify(left,     p1, p2, 25, 0); 
  23. display("left 25  ", x, 2, high); display(p1, x++, 14, alt_reverse); 
  24. /*    */
  25. justify(right,    p1, p2, 15, 0); 
  26. display("right 15 ", x, 2, high); display(p1, x++, 14, alt_reverse); 
  27. /*    */
  28. justify(right,    p1, p2, 25, 0); 
  29. display("right 25 ", x, 2, high); display(p1, x++, 14, alt_reverse);
  30. /*    */
  31. justify(as_typed, p1, p2, 15, 0); 
  32. display("as_typed 15", x, 2, high); display(p1, x++, 14, alt_reverse); 
  33. /*    */
  34. justify(center,   p1, p2, 36, 0); 
  35. display("center 36", x, 2, high); display(p1, x++, 14, alt_reverse); 
  36. /*    */
  37. justify(code,     p1, p2, 12, 0); 
  38. display("code 12 ", x, 2, high); display(p1, x++, 14, alt_reverse); 
  39. /*    */
  40. justify(code,     p1, p2,  6, 0); 
  41. display("code 6  ", x, 2, high); display(p1, x++, 14, alt_reverse); 
  42. /*    */
  43. justify(decimal,  p1, p2,  6, 2); 
  44. display("decimal 6.2", x, 2, high); display(p1, x++, 14, alt_reverse); 
  45. /*    */
  46. justify(decimal,  p1, p2,  7, 5); 
  47. display("decimal 7.5", x, 2, high); display(p1, x++, 14, alt_reverse); 
  48. /*    */
  49. justify(c_number, p1, p2,  7, 1); 
  50. display("c_number 7.1", x, 2, high); display(p1, x++, 14, alt_reverse); 
  51. /*    */
  52. justify(decimal, p1, p2,  5, 0); 
  53. display("decimal 5.0", x, 2, high); display(p1, x++, 14, alt_reverse); 
  54. /*    */
  55. justify(c_number, p1, p2,  4, 5); 
  56. display("c_number 4.5", x, 2, high); display(p1, x++, 14, alt_reverse); 
  57. /*
  58. *
  59. */
  60. while (!disp_qry(" Ready to finish")); 
  61. goodbye(0);
  62. }
  63.